<template>
	<view>
		<view class="flex f-a-c j-s-b search f14">
			<input type="text" placeholder="输入运单单号或者订单号搜索..." @blur="hand" v-model="keyword" style="width: 100%;">
			<i class="iconfont icon-scan f22" @click="handScanCode"/>
		</view>
	</view>
</template>

<script>
	export default {
		name:"search",
		data() {
			return {
				keyword:''
			};
		},
		methods:{
			hand(e){
				this.$emit('blur',this.keyword)
			},
			handScanCode(){
				uni.scanCode({
					success:e=>{
						this.keyword = e.result
						this.$emit('blur',this.keyword)
						// this.$emit('scanCode',e)
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.search{
		background: #f5f5f5;
		padding: 28rpx 20rpx;
		border-radius: 12rpx;
		margin: 44rpx 32rpx;
	}
</style>